{{ define "main" }}
<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">

                <!--
                {{ if not (eq (.Param "showtoc") false) }}
                <header>
                    <h2>TOC</h2>
                </header>
                {{.TableOfContents}}
                {{ end }}
                -->
                {{ .Content }}

                {{ if .Site.Params.reward }}
                {{ partial "reward.html" . }}
                {{ end }}

                {{ if or (.PrevInSection) (.NextInSection) }}
                <hr>
                <ul class="pager">
                    {{ if .PrevInSection }}
                    <li class="previous">
                        <a href="{{ .PrevInSection.RelPermalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title}}">&larr;
                            Previous Post</a>
                    </li>
                    {{ end }}
                    {{ if .NextInSection }}
                    <li class="next">
                        <a href="{{ .NextInSection.RelPermalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title}}">Next
                            Post &rarr;</a>
                    </li>
                    {{ end }}
                </ul>
                {{ end }}

                {{ partial "comments.html" . }}
            </div>

            <!-- Side Catalog Container -->
            {{ if not (eq (.Param "showtoc") false) }}
            <div class="
                col-lg-2 col-lg-offset-0
                visible-lg-block
                sidebar-container
                catalog-container">
                <div class="side-catalog">
                    <hr class="hidden-sm hidden-xs">
                    <h5>
                        <a class="catalog-toggle" href="#">CATALOG</a>
                    </h5>
                    <ul class="catalog-body"></ul>
                </div>
            </div>
            {{ end }}

            <!-- Sidebar Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                <!-- Featured Tags -->
                {{ if .Site.Params.featured_tags }}
                <section>
                    <hr class="hidden-sm hidden-xs">
                    <h5><a href="/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                        {{ $featured_condition_size := .Site.Params.featured_condition_size }}
                        {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
                        {{ if gt (len $taxonomy.Pages) $featured_condition_size }}
                        <a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
                            {{ $name }}
                        </a>
                        {{ end }}
                        {{ end }}
                    </div>
                </section>
                {{ end }}

                <!-- Friends Blog -->
                {{ if .Site.Params.friends }}
                <section>
                    <hr>
                    <h5>FRIENDS</h5>
                    <ul class="list-inline">
                        {{ range .Site.Params.friend_link }}
                        <li><a target="_blank" href="{{.href}}">{{.title}}</a></li>
                        {{ end }}
                    </ul>
                </section>
                {{ end }}
            </div>
        </div>
    </div>
</article>

{{ end }}
